﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Manageweb_Welcome : System.Web.UI.Page
{
    MODEL.Master MM = new MODEL.Master();
    MODEL.Master _MM = new MODEL.Master();

    BLL.Master BM = new BLL.Master();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Cookies["MasterID"] == null)
        {
            Response.Redirect("Default.aspx");
        }

        if (!IsPostBack)
        {
            PageDataInit();
        }
    }

    protected void PageDataInit()
    {
        MM.Master_ID = Convert.ToInt32(Session["MasterID"]);
        _MM = BM.GetDataByID(MM);
        LB_MasterName.Text = _MM.Master_LoginID;

        LB_IP.Text = Request.ServerVariables["Remote_Addr"];
        LB_ExpireTime.Text = Session.Timeout.ToString();
        LB_NowTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
        LB_ServerName.Text = Request.ServerVariables["Server_name"];
        LB_ServerOS.Text = Environment.OSVersion.ToString();

        LB_UserAgent.Text = Request.ServerVariables["Http_User_Agent"].ToString();

        LB_CPUNum.Text = Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS").ToString();
        LB_CPUType.Text = Environment.GetEnvironmentVariable("PROCESSOR_IDENTIFIER").ToString();
        LB_PhysicalPath.Text = Request.ServerVariables["APPL_PHYSICAL_PATH"].ToString();
        LB_DotNetVersion.Text = ".NET CLR " + Environment.Version.ToString();
        LB_TimeArea.Text = (DateTime.Now - DateTime.UtcNow).TotalHours > 0 ? "+" + (DateTime.Now -
            DateTime.UtcNow).TotalHours.ToString() : (DateTime.Now - DateTime.UtcNow).TotalHours.ToString();
        LB_ScriptTimeout.Text = Server.ScriptTimeout.ToString();
        LB_ServerStart.Text = ((Double)System.Environment.TickCount / 3600000).ToString("N2");
        LB_SessionNum.Text = Session.Contents.Count.ToString();
        LB_ApplicationNum.Text = Application.Contents.Count.ToString();
    }
}
